<?php

namespace Regard\InstituteBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TariffType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name', 'text')
            ->add('price', 'text')
            ->add('description', 'textarea', array('required' => false))
            ->add('category', 'hidden')
            ->add('thumbnail', 'hidden', array('required' => false))
            ->add('picture', 'file', array('data_class' => null,
										'property_path' => 'picture',
										'required' => false))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Regard\InstituteBundle\Entity\Tariff'
        ));
    }

    public function getName()
    {
        return 'regard_institutebundle_tarifftype';
    }
}
